#ifndef __SQLPARSER_H
#define __SQLPARSER_H

#include "VCppEFLiteDll.h"
#include <sstream>
#include <iostream>
#include <list>
#include <vector>

using namespace EFLite;


struct ColumnValuePair{
		string columnName;
		Cell *Value;
	};

class SQLParser
{
	DBContext *DB;
public:
	int Parse(string Query, Entity *result);
	int ResolveSelect(vector<string> columns, vector<string> tables, Predicate* p, Entity *result);
	int ResolveInsert(string TableName, vector<ColumnValuePair> Values);
	int ResolveUpdate(string TableName, vector<ColumnValuePair> Changes, Predicate* p);
	int ResolveDelete(string TableName, Predicate* p);
	int ResolveCreate(string TableName, vector<CD> columns);
	int ResolveDrop(string TableName);

	SQLParser(DBContext *db) { DB = db; }
};
#endif